﻿using System.Collections.Generic;
using System.Diagnostics.Contracts;
using Pipeline.Middleware.Common;

namespace Pipeline.Middleware.Functional
{

    public interface IApplication
    {
        Context Run();
    }

    public class Application : IApplication
    {
        private readonly RequestDelegate _request;

        public Application(RequestDelegate request)
        {
            _request = request;
        }

        public Context Run()
        {
         return  _request(new Context(new Request(), new Response()));
        }
    }

}